﻿package ygg.exporter.swf
{
	import j.sus2maj7.exporter.*;
	import j.sus2maj7.context.*;
	
	import ygg.encoding.swf.tag.TagType;
	
	import ygg.exporter.swf.tag.*;
	
	public class TagExporterFactory extends AbstractExporterFactory
	{
		
		override public function getExporter(o:*, context:IContext = null):IExporter
		{
			var retVal:IExporter;
			
			var type:uint = o as uint;
			switch (type)
			{
				case TagType.END:
					retVal = new EndExporter();		//00
					break;
				case TagType.SHOW_FRAME:
					retVal = new ShowFrameExporter();		//01
					break;
				case TagType.DEFINE_SHAPE:
					retVal = new DefineShapeExporter();		//02
					break;
				case TagType.FREE_CHARACTER:
					retVal = new FreeCharacterExporter();		//03 not in spec
					break;
				case TagType.PLACE_OBJECT:
					retVal = new PlaceObjectExporter();		//04
					break;
				case TagType.REMOVE_OBJECT:
					retVal = new RemoveObjectExporter();		//05
					break;
				case TagType.DEFINE_BITS:
					retVal = new DefineBitsExporter();		//06
					break;
				case TagType.DEFINE_BUTTON:
					retVal = new DefineButtonExporter();		//07
					break;
				case TagType.JPEGTABLES:
					retVal = new JPEGTablesExporter();		//08
					break;
				case TagType.SET_BACKGROUND_COLOR:
					retVal = new SetBackgroundColorExporter();		//09
					break;
				case TagType.DEFINE_FONT:
					retVal = new DefineFontExporter();		//10
					break;
				case TagType.DEFINE_TEXT:
					retVal = new DefineTextExporter();		//11
					break;
				case TagType.DO_ACTION:
					retVal = new DoActionExporter();		//12
					break;
				case TagType.DEFINE_FONT_INFO:
					retVal = new DefineFontInfoExporter();		//13
					break;
				case TagType.DEFINE_SOUND:
					retVal = new DefineSoundExporter();		//14
					break;
				case TagType.START_SOUND:
					retVal = new StartSoundExporter();		//15
					break;
				case TagType.STOP_SOUND:
					retVal = new StopSoundExporter();		//16 not in spec
					break;
				case TagType.DEFINE_BUTTON_SOUND:
					retVal = new DefineButtonSoundExporter();		//17
					break;
				case TagType.SOUND_STREAM_HEAD:
					retVal = new SoundStreamHeadExporter();		//18
					break;
				case TagType.SOUND_STREAM_BLOCK:
					retVal = new SoundStreamBlockExporter();		//19
					break;
				case TagType.DEFINE_BITS_LOSSLESS:
					retVal = new DefineBitsLosslessExporter();		//20
					break;
				case TagType.DEFINE_BITS_JPEG_2:
					retVal = new DefineBitsJPEG2Exporter();		//21
					break;
				case TagType.DEFINE_SHAPE_2:
					retVal = new DefineShape2Exporter();		//22
					break;
				case TagType.DEFINE_BUTTON_CXFORM:
					retVal = new DefineButtonCxformExporter();		//23
					break;
				case TagType.PROTECT:
					retVal = new ProtectExporter();		//24
					break;
				case TagType.PATHS_ARE_POST_SCRIPT:
					retVal = new PathsArePostScriptExporter();		//25 not in spec
					break;
				case TagType.PLACE_OBJECT_2:
					retVal = new PlaceObject2Exporter();		//26
					break;
				case TagType.REMOVE_OBJECT_2:
					retVal = new RemoveObject2Exporter();		//28
					break;
				case TagType.SYNC_FRAME:
					retVal = new SyncFrameExporter();		//29 not in spec
					break;
				case TagType.FREE_ALL:
					retVal = new FreeAllExporter();		//31 not in spec
					break;
				case TagType.DEFINE_SHAPE_3:
					retVal = new DefineShape3Exporter();		//32
					break;
				case TagType.DEFINE_TEXT_2:
					retVal = new DefineText2Exporter();		//33
					break;
				case TagType.DEFINE_BUTTON_2:
					retVal = new DefineButton2Exporter();		//34
					break;
				case TagType.DEFINE_BITS_JPEG_3:
					retVal = new DefineBitsJPEG3Exporter();		//35
					break;
				case TagType.DEFINE_BITS_LOSSLESS_2:
					retVal = new DefineBitsLossless2Exporter();		//36
					break;
				case TagType.DEFINE_EDIT_TEXT:
					retVal = new DefineEditTextExporter();		//37
					break;
				case TagType.DEFINE_VIDEO:
					retVal = new DefineVideoExporter();		//38 not in spec
					break;
				case TagType.DEFINE_SPRITE:
					retVal = new DefineSpriteExporter();		//39
					break;
				case TagType.NAME_CHARACTER:
					retVal = new NameCharacterExporter();		//40 not in spec
					break;
				case TagType.PRODUCT_INFO:
					retVal = new ProductInfoExporter();		//41 not in spec
					break;
				case TagType.DEFINE_TEXT_FORMAT:
					retVal = new DefineTextFormatExporter();		//42 not in spec
					break;
				case TagType.FRAME_LABEL:
					retVal = new FrameLabelExporter();		//43
					break;
				case TagType.DEFINE_BEHAVIOR:
					retVal = new DefineBehaviorExporter();		//44 not in spec
					break;
				case TagType.SOUND_STREAM_HEAD_2:
					retVal = new SoundStreamHead2Exporter();		//45
					break;
				case TagType.DEFINE_MORPH_SHAPE:
					retVal = new DefineMorphShapeExporter();		//46
					break;
				case TagType.FRAME_TAG:
					retVal = new FrameTagExporter();		//47 not in spec
					break;
				case TagType.DEFINE_FONT_2:
					retVal = new DefineFont2Exporter();		//48
					break;
				case TagType.GEN_COMMAND:
					retVal = new GenCommandExporter();		//49 not in spec
					break;
				case TagType.DEFINE_COMMAND_OBJ:
					retVal = new DefineCommandObjExporter();		//50 not in spec
					break;
				case TagType.CHARACTER_SET:
					retVal = new CharacterSetExporter();		//51 not in spec
					break;
				case TagType.FONT_REF:
					retVal = new FontRefExporter();		//52 not in spec
					break;
				case TagType.DEFINE_FUNCTION:
					retVal = new DefineFunctionExporter();		//53 not in spec
					break;
				case TagType.PLACE_FUNCTION:
					retVal = new PlaceFunctionExporter();		//54 not in spec
					break;
				case TagType.GEN_TAG_OBJECT:
					retVal = new GenTagObjectExporter();		//55 not in spec
					break;
				case TagType.EXPORT_ASSETS:
					retVal = new ExportAssetsExporter();		//56
					break;
				case TagType.IMPORT_ASSETS:
					retVal = new ImportAssetsExporter();		//57
					break;
				case TagType.ENABLE_DEBUGGER:
					retVal = new EnableDebuggerExporter();		//58
					break;
				case TagType.DO_INIT_ACTION:
					retVal = new DoInitActionExporter();		//59
					break;
				case TagType.DEFINE_VIDEO_STREAM:
					retVal = new DefineVideoStreamExporter();		//60
					break;
				case TagType.VIDEO_FRAME:
					retVal = new VideoFrameExporter();		//61
					break;
				case TagType.DEFINE_FONT_INFO_2:
					retVal = new DefineFontInfo2Exporter();		//62
					break;
				case TagType.DEBUG_ID:
					retVal = new DebugIDExporter();		//63 not in spec
					break;
				case TagType.ENABLE_DEBUGGER_2:
					retVal = new EnableDebugger2Exporter();		//64
					break;
				case TagType.SCRIPT_LIMITS:
					retVal = new ScriptLimitsExporter();		//65
					break;
				case TagType.SET_TAB_INDEX:
					retVal = new SetTabIndexExporter();		//66
					break;
				case TagType.FILE_ATTRIBUTES:
					retVal = new FileAttributesExporter();		//69
					break;
				case TagType.PLACE_OBJECT_3:
					retVal = new PlaceObject3Exporter();		//70
					break;
				case TagType.IMPORT_ASSETS_2:
					retVal = new ImportAssets2Exporter();		//71
					break;
				case TagType.DO_ABC:
					retVal = new DoABCExporter();		//72 not in spec
					break;
				case TagType.DEFINE_FONT_ALIGN_ZONES:
					retVal = new DefineFontAlignZonesExporter();		//73
					break;
				case TagType.CSMTEXT_SETTINGS:
					retVal = new CSMTextSettingsExporter();		//74
					break;
				case TagType.DEFINE_FONT_3:
					retVal = new DefineFont3Exporter();		//75
					break;
				case TagType.SYMBOL_CLASS:
					retVal = new SymbolClassExporter();		//76
					break;
				case TagType.METADATA:
					retVal = new MetadataExporter();		//77
					break;
				case TagType.DEFINE_SCALING_GRID:
					retVal = new DefineScalingGridExporter();		//78
					break;
				case TagType.DO_ABC_2:
					retVal = new DoABC2Exporter();		//82
					break;
				case TagType.DEFINE_SHAPE_4:
					retVal = new DefineShape4Exporter();		//83
					break;
				case TagType.DEFINE_MORPH_SHAPE_2:
					retVal = new DefineMorphShape2Exporter();		//84
					break;
				case TagType.DEFINE_SCENE_AND_FRAME_LABEL_DATA:
					retVal = new DefineSceneAndFrameLabelDataExporter();		//86
					break;
				case TagType.DEFINE_BINARY_DATA:
					retVal = new DefineBinaryDataExporter();		//87
					break;
				case TagType.DEFINE_FONT_NAME:
					retVal = new DefineFontNameExporter();		//88
					break;
				case TagType.START_SOUND_2:
					retVal = new StartSound2Exporter();		//89
					break;
				case TagType.DEFINE_BITS_JPEG_4:
					retVal = new DefineBitsJPEG4Exporter();		//90
					break;
				case TagType.DEFINE_FONT_4:
					retVal = new DefineFont4Exporter();		//91
				default:
			}
			
			return retVal;
		}
		
	}
}